// 定义商品类别组件
Vue.component("category",{
	// ==>  data : { clist : []  }
	data(){
		return {
			clist :[]
		};
	},
	template : 
		`
		<div class="span24">
			<ul class="mainNav">
				<li><a href="index.html">首页</a> |</li>
				<li><a v-for="c in clist" :href="'clist.html?cid='+c.cid">
					{{c.cname}} </a> |</li>
			</ul>
		</div>
		`,
	created(){
		axios.get("clist.s").then(res=>{
			this.clist = res.data;
		});
		
	}
});
Vue.component("bigflgory",{
	data(){
		return{
			clist:[],
			clist1:[]
			};
	},
	template:
`	<div><dl v-for="(c,index) in clist">
		<dt>
			<a  :href='"clist.html?cid=" + c.cid'>{{c.cname}}</a>
		</dt>
							
		      <dd   v-if= "d.cid ==c.cid"  v-for= "d in clist1"  >
				<a :href='"clist.html?csid=" +d.csid'> {{d.csname}}</a>
	          </dd>
												
     </dl>	</div>`,
	created(){
		axios.get("fl.s").then(res=>{
			this.clist1 = res.data;
		})
		axios.get("clist.s").then(res=>{
			this.clist = res.data;
		});
	}
})